
<h2>New shipment for Order # <%= @order.number %>  </h2>
<div class='' >
  Shipment for <%= @order.user.name %>
</div>
<div class='clear'></div>
<div id='order-shipment-items' class='span-7 last float-left'>
<h4>Order Items</h4>
  <% @order.order_items.each_with_index do |item,i| %>
    <div  id='order-shipment-item<%= i %>'
          class='span-6 rounded-4 line_item_yellow'>

        <%= item.variant.product_name %> <%= item.variant.sku %> <%= number_to_currency item.variant.price %> <br/>
        <% if item.shipped? %>
          Shipped: <%= item.shipment.display_shipped_at %> => Shipping #: <%= item.shipment.number %>
        <% else %>
          Not Shipped Yet.
          <%= item.shipping_rate.shipping_method.name %>
        <% end %>

    </div>
  <% end %>
</div>
<div class='span-7 last float-left' >
<h4>Shipping address</h4>
  <div  id='order-ship-address'
        class='span-6 rounded-4 line_item_yellow'>
    <%= render :partial => '/shared/compact_address', :locals => {:shopping_address => @order.ship_address} %>
  </div>
</div>
<div class='span-7 last float-left'>
<h4>Shipment Details</h4>
  <% if @order.shipments.empty? %>
    No Shipments have been made on this order.
  <% end %>
  <% @order.shipments.each do |shipment| %>
      <div  id='order-shipment-items'
            class='span-6 rounded-4 <%= cycle("line_item_yellow", "line_item_gray") %>'>
          Shipping Method: <%= shipment.shipping_method.name %> <br/>
          Shipping #: <%= shipment.number %> Tracking:<%= shipment.tracking %> State:<%= shipment.state %>
      </div>
  <% end %>
</div>
<div class='clear'></div>
Ask if you want to authorize full amount of partial with reason<br/>
<div class='span-12 last'>
  <% @order.invoices.each do |invoice| %>
    <div style='display:inline-block;' class='line_item_gray'> <%= invoice.state %> Invoice:</div>
    <%=  invoice.number %> => <%= number_to_currency invoice.amount %>
    <% if invoice.authorized? %>
      <a id='capture-invoice-button' style='display:inline-block;' class='line_item_blue'>
        Collect
      </a>
    <% end %>
    <br/>
  <% end %>
</div>


AUTHORIZE AND SHIP BUTTON.<br/>  AUTHORIZE PARTIAL AND CANCEL items.<br/>
CANCEL BUTTON. (put this button in a place not easily clicked.)
<%#= render 'form' %>

<%= link_to 'All Shipments', admin_fulfillment_shipments_path(:order_id => @shipment.order_id) %>
